package com.yanqu.road.server.manager.activity.dragonboatrace;

import com.yanqu.road.entity.activity.ActivityConfig;
import com.yanqu.road.entity.activity.dragonboatrace.config.DragonBoatRacePlaceConfig;
import com.yanqu.road.entity.activity.dragonboatrace.config.DragonBoatRaceSpeedConfig;
import com.yanqu.road.utils.string.StringUtils;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @Description
 * @Author cwq
 * @Data 2022/2/28 8:53
 */
public class DragonBoatRaceConfig {

    public int DRAGONBOATRACE_SCORE_ITEM_ID = 101957;// 龙舟积分id
    public int DRAGONBOATRACE_TIMES = 3;// 每日游戏次数
    public int DRAGONBOATRACE_DAILY_OPEN_TIME = 10;// 每日游戏开始时间（h）
    public int DRAGONBOATRACE_DAILY_END_TIME = 22;// 每日游戏结束时间（h）
    public int DRAGONBOATRACE_ENDING_TIME = 2;// 每日结束前几分钟不能参加比赛（m）
    public int DRAGONBOATRACE_PATRONS_NUM = 4;// 参赛门客数量
    public int DRAGONBOATRACE_INIT_SPEED = 10;// 初始速度
    public int DRAGONBOATRACE_GAME_TIME = 60;// 游戏时长(s)
    public int DRAGONBOATRACE_GAME_CD_TIME = 3600;// 游戏冷却时长(s)
    public int DRAGONBOATRACE_RANDOM_START_RANGE = 6;// 随机障碍物时间范围 (开始范围) （s）
    public int DRAGONBOATRACE_RANDOM_END_RANGE = 10;// 随机障碍物时间范围(结束范围) （s）
    public int DRAGONBOATRACE_CLICK_DRUM_CD = 1200;// 击鼓cd时间(ms)
    public int DRAGONBOATRACE_CLICK_DRUM_KEEP_TIME = 1000;// 鼓舞持续时间(ms)
    public int DRAGONBOATRACE_BREAK_OBSTACLE_VALUE = 500;// 冲破障碍物提升基础速度(千分比)
    public int DRAGONBOATRACE_BREAK_OBSTACLE_TIME = 2;// 冲破障碍物效果时间（s）
    public int DRAGONBOATRACE_OBSTACLE_VALUE = 500;// 障碍物效果(千分比)
    public int DRAGONBOATRACE_OBSTACLE_TIME = 2;// 障碍物持续时间（s）
    public int DRAGONBOATRACE_PATRONS_EXP_COEFFICIENT_1 = 50;// 百业经验系数1
    public int DRAGONBOATRACE_PATRONS_EXP_COEFFICIENT_2 = 1000;// 百业经验系数2
    public int DRAGONBOATRACE_PRODUCE_OBSTACLE_DISTANCE = 1000;// 生成障碍物的距离
    public int DRAGONBOATRACE_PREPARATION_TIME = 3;// 游戏准备时间(s)
    public String DRAGONBOATRACE_OBSTACLE_PIXEL_VALUE = "200;500";// 石头障碍物影响背景速度(加速;减速)
    public int DRAGONBOATRACE_OBSTACLE_CUE_DISTANCE = 500;// 石头障碍物气泡提示距离(像素)
    public String DRAGONBOATRACE_PATRONS_LEVEL_COEFFICIENT = "250;56";// 门客系数(参数1;参数2)

    /**
     * 比赛道具
     */
    public List<Integer> DRAGONBOATRACE_ENERGY_ITEM_LIST = new ArrayList();
    /**
     * 免费道具
     */
    public List<Integer> DRAGONBOATRACE_FREE_ENERGY_ITEM_LIST = new ArrayList<>();
    /**
     * 门客系数(参数1;参数2)    250;56
     */
    public List<Integer> patronsLevelCoefficient = new ArrayList();
    /**
     * 加速配置
     */
    public List<DragonBoatRaceSpeedConfig> speedList = new ArrayList<>();

    /**
     * 地方配置
     */
    public List<DragonBoatRacePlaceConfig> placeConfigList = new ArrayList<>();
    /**
     * 地方配置
     */
    public Map<Integer, DragonBoatRacePlaceConfig> placeConfigMap = new HashMap<>();


    /**
     * 初始化活动配置
     *
     * @return
     */
    public void parseConfig(Map<String, ActivityConfig> configMap) {
        //配置
        DRAGONBOATRACE_SCORE_ITEM_ID = Integer.valueOf(configMap.get("DRAGONBOATRACE_SCORE_ITEM_ID").getValue());
        DRAGONBOATRACE_TIMES = Integer.valueOf(configMap.get("DRAGONBOATRACE_TIMES").getValue());
        DRAGONBOATRACE_DAILY_OPEN_TIME = Integer.valueOf(configMap.get("DRAGONBOATRACE_DAILY_OPEN_TIME").getValue());
        DRAGONBOATRACE_DAILY_END_TIME = Integer.valueOf(configMap.get("DRAGONBOATRACE_DAILY_END_TIME").getValue());
        DRAGONBOATRACE_ENDING_TIME = Integer.valueOf(configMap.get("DRAGONBOATRACE_ENDING_TIME").getValue());
        DRAGONBOATRACE_PATRONS_NUM = Integer.valueOf(configMap.get("DRAGONBOATRACE_PATRONS_NUM").getValue());
        DRAGONBOATRACE_INIT_SPEED = Integer.valueOf(configMap.get("DRAGONBOATRACE_INIT_SPEED").getValue());
        DRAGONBOATRACE_GAME_TIME = Integer.valueOf(configMap.get("DRAGONBOATRACE_GAME_TIME").getValue());
        DRAGONBOATRACE_GAME_CD_TIME = Integer.valueOf(configMap.get("DRAGONBOATRACE_GAME_CD_TIME").getValue());
        DRAGONBOATRACE_RANDOM_START_RANGE = Integer.valueOf(configMap.get("DRAGONBOATRACE_RANDOM_START_RANGE").getValue());
        DRAGONBOATRACE_RANDOM_END_RANGE = Integer.valueOf(configMap.get("DRAGONBOATRACE_RANDOM_END_RANGE").getValue());
        DRAGONBOATRACE_CLICK_DRUM_CD = Integer.valueOf(configMap.get("DRAGONBOATRACE_CLICK_DRUM_CD").getValue());
        DRAGONBOATRACE_CLICK_DRUM_KEEP_TIME = Integer.valueOf(configMap.get("DRAGONBOATRACE_CLICK_DRUM_KEEP_TIME").getValue());
        DRAGONBOATRACE_BREAK_OBSTACLE_TIME = Integer.valueOf(configMap.get("DRAGONBOATRACE_BREAK_OBSTACLE_TIME").getValue());
        DRAGONBOATRACE_BREAK_OBSTACLE_VALUE = Integer.valueOf(configMap.get("DRAGONBOATRACE_BREAK_OBSTACLE_VALUE").getValue());
        DRAGONBOATRACE_OBSTACLE_VALUE = Integer.valueOf(configMap.get("DRAGONBOATRACE_OBSTACLE_VALUE").getValue());
        DRAGONBOATRACE_OBSTACLE_TIME = Integer.valueOf(configMap.get("DRAGONBOATRACE_OBSTACLE_TIME").getValue());
        DRAGONBOATRACE_PRODUCE_OBSTACLE_DISTANCE = Integer.valueOf(configMap.get("DRAGONBOATRACE_PRODUCE_OBSTACLE_DISTANCE").getValue());
        DRAGONBOATRACE_PREPARATION_TIME = Integer.valueOf(configMap.get("DRAGONBOATRACE_PREPARATION_TIME").getValue());
        DRAGONBOATRACE_OBSTACLE_PIXEL_VALUE = String.valueOf(configMap.get("DRAGONBOATRACE_OBSTACLE_PIXEL_VALUE").getValue());
        DRAGONBOATRACE_OBSTACLE_CUE_DISTANCE = Integer.valueOf(configMap.get("DRAGONBOATRACE_OBSTACLE_CUE_DISTANCE").getValue());
        DRAGONBOATRACE_ENERGY_ITEM_LIST = StringUtils.stringToIntegerList(configMap.get("DRAGONBOATRACE_ENERGY_ITEM_LIST").getValue(), ";");
        DRAGONBOATRACE_FREE_ENERGY_ITEM_LIST = StringUtils.stringToIntegerList(configMap.get("DRAGONBOATRACE_FREE_ENERGY_ITEM_LIST").getValue(), ";");
        DRAGONBOATRACE_PATRONS_LEVEL_COEFFICIENT = String.valueOf(configMap.get("DRAGONBOATRACE_PATRONS_LEVEL_COEFFICIENT").getValue());
        List<Integer> patronsExpCoefficientList = StringUtils.stringToIntegerList(configMap.get("DRAGONBOATRACE_PATRONS_EXP_COEFFICIENT").getValue(), ";");
        DRAGONBOATRACE_PATRONS_EXP_COEFFICIENT_1 = patronsExpCoefficientList.get(0);
        DRAGONBOATRACE_PATRONS_EXP_COEFFICIENT_2 = patronsExpCoefficientList.get(1);
        patronsLevelCoefficient = StringUtils.stringToIntegerList(configMap.get("DRAGONBOATRACE_PATRONS_LEVEL_COEFFICIENT").getValue(), ";");

        for (DragonBoatRacePlaceConfig item : placeConfigList) {
            placeConfigMap.put(item.getId(), item);
        }
    }

    public int getDRAGONBOATRACE_SCORE_ITEM_ID() {
        return DRAGONBOATRACE_SCORE_ITEM_ID;
    }

    public int getDRAGONBOATRACE_TIMES() {
        return DRAGONBOATRACE_TIMES;
    }

    public int getDRAGONBOATRACE_DAILY_OPEN_TIME() {
        return DRAGONBOATRACE_DAILY_OPEN_TIME;
    }

    public int getDRAGONBOATRACE_DAILY_END_TIME() {
        return DRAGONBOATRACE_DAILY_END_TIME;
    }

    public int getDRAGONBOATRACE_ENDING_TIME() {
        return DRAGONBOATRACE_ENDING_TIME;
    }

    public int getDRAGONBOATRACE_PATRONS_NUM() {
        return DRAGONBOATRACE_PATRONS_NUM;
    }

    public int getDRAGONBOATRACE_INIT_SPEED() {
        return DRAGONBOATRACE_INIT_SPEED;
    }

    public int getDRAGONBOATRACE_GAME_TIME() {
        return DRAGONBOATRACE_GAME_TIME;
    }

    public int getDRAGONBOATRACE_GAME_CD_TIME() {
        return DRAGONBOATRACE_GAME_CD_TIME;
    }

    public int getDRAGONBOATRACE_RANDOM_START_RANGE() {
        return DRAGONBOATRACE_RANDOM_START_RANGE;
    }

    public int getDRAGONBOATRACE_RANDOM_END_RANGE() {
        return DRAGONBOATRACE_RANDOM_END_RANGE;
    }

    public int getDRAGONBOATRACE_CLICK_DRUM_CD() {
        return DRAGONBOATRACE_CLICK_DRUM_CD;
    }

    public int getDRAGONBOATRACE_CLICK_DRUM_KEEP_TIME() {
        return DRAGONBOATRACE_CLICK_DRUM_KEEP_TIME;
    }

    public int getDRAGONBOATRACE_BREAK_OBSTACLE_VALUE() {
        return DRAGONBOATRACE_BREAK_OBSTACLE_VALUE;
    }

    public int getDRAGONBOATRACE_BREAK_OBSTACLE_TIME() {
        return DRAGONBOATRACE_BREAK_OBSTACLE_TIME;
    }

    public int getDRAGONBOATRACE_OBSTACLE_VALUE() {
        return DRAGONBOATRACE_OBSTACLE_VALUE;
    }

    public int getDRAGONBOATRACE_OBSTACLE_TIME() {
        return DRAGONBOATRACE_OBSTACLE_TIME;
    }

    public int getDRAGONBOATRACE_PATRONS_EXP_COEFFICIENT_1() {
        return DRAGONBOATRACE_PATRONS_EXP_COEFFICIENT_1;
    }

    public int getDRAGONBOATRACE_PATRONS_EXP_COEFFICIENT_2() {
        return DRAGONBOATRACE_PATRONS_EXP_COEFFICIENT_2;
    }

    public int getDRAGONBOATRACE_PRODUCE_OBSTACLE_DISTANCE() {
        return DRAGONBOATRACE_PRODUCE_OBSTACLE_DISTANCE;
    }

    public int getDRAGONBOATRACE_PREPARATION_TIME() {
        return DRAGONBOATRACE_PREPARATION_TIME;
    }

    public String getDRAGONBOATRACE_OBSTACLE_PIXEL_VALUE() {
        return DRAGONBOATRACE_OBSTACLE_PIXEL_VALUE;
    }

    public int getDRAGONBOATRACE_OBSTACLE_CUE_DISTANCE() {
        return DRAGONBOATRACE_OBSTACLE_CUE_DISTANCE;
    }

    public String getDRAGONBOATRACE_PATRONS_LEVEL_COEFFICIENT() {
        return DRAGONBOATRACE_PATRONS_LEVEL_COEFFICIENT;
    }

    public List<Integer> getDRAGONBOATRACE_ENERGY_ITEM_LIST() {
        return DRAGONBOATRACE_ENERGY_ITEM_LIST;
    }

    public List<Integer> getDRAGONBOATRACE_FREE_ENERGY_ITEM_LIST() {
        return DRAGONBOATRACE_FREE_ENERGY_ITEM_LIST;
    }

    public List<Integer> getPatronsLevelCoefficient() {
        return patronsLevelCoefficient;
    }

    public List<DragonBoatRaceSpeedConfig> getSpeedList() {
        return speedList;
    }

    public void setSpeedList(List<DragonBoatRaceSpeedConfig> speedList) {
        speedList = speedList;
    }

    public List<DragonBoatRacePlaceConfig> getPlaceConfigList() {
        return placeConfigList;
    }

    public void setPlaceConfigList(List<DragonBoatRacePlaceConfig> placeConfigList) {
        this.placeConfigList = placeConfigList;
    }

    public Map<Integer, DragonBoatRacePlaceConfig> getPlaceConfigMap() {
        return placeConfigMap;
    }

    public void setPlaceConfigMap(Map<Integer, DragonBoatRacePlaceConfig> placeConfigMap) {
        this.placeConfigMap = placeConfigMap;
    }

}

